package com.ems.controller.system;

import com.ems.pojo.data.ResultData;
import com.ems.pojo.data.RetunResult;
import com.ems.pojo.user.User;
import com.ems.service.system.SystemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @Auther: 伟伟
 * @Date: 2019/10/29
 * @Description: 处理一些系统的信息（系统通知）
 * @Version: 1.0
 */
@Controller
@CrossOrigin //允许所有请求跨域
@RequestMapping("/systemController")
public class SystemController {

    @Autowired
    private SystemService systemService;

    /**
     * 用户找回密码
     * @param user
     * @return
     */
    @RequestMapping("/findPassword")
    @ResponseBody
    public ResultData findPassword(@RequestBody User user, HttpServletRequest request){
         int result = systemService.findPassword(user);
         return RetunResult.AssemblyData(result);
    }

}
